home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / dev / gg / ncurses-5.3.lha / ncurses-5.3 / headers.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  2002-10-24  |  901b  |  38 lines

  1. #! /bin/sh
  2. # This shell script is generated by the 'configure' script.  It is invoked in a
  3. # subdirectory of the build tree.  It generates a sed-script in the parent
  4. # directory that is used to adjust includes for header files that reside in a
  5. # subdirectory of /usr/include, etc.
  6. PRG=""
  7. while test $# != 3
  8. do
  9. PRG="$PRG $1"; shift
  10. done
  11. DST=$1
  12. REF=$2
  13. SRC=$3
  14. TMPSRC=${TMPDIR-/tmp}/`basename $SRC`$$
  15. TMPSED=${TMPDIR-/tmp}/headers.sed$$
  16. echo installing $SRC in $DST
  17. case $DST in
  18. /*/include/*)
  19.     END=`basename $DST`
  20.     for i in `cat $REF/../*/headers |fgrep -v "#"`
  21.     do
  22.         NAME=`basename $i`
  23.         echo "s/<$NAME>/<$END\/$NAME>/" >> $TMPSED
  24.     done
  25.     ;;
  26. *)
  27.     echo "" >> $TMPSED
  28.     ;;
  29. esac
  30. rm -f $TMPSRC
  31. sed -f $TMPSED $SRC > $TMPSRC
  32. NAME=`basename $SRC`
  33. # Just in case someone gzip'd manpages, remove the conflicting copy.
  34. test -f $DST/$NAME.gz && rm -f $DST/$NAME.gz
  35.  
  36. eval $PRG $TMPSRC $DST/$NAME
  37. rm -f $TMPSRC $TMPSED
  38.